package com.melody.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.melody.entry.MusicLabel;
import com.melody.service.MusicLabelService;
import com.melody.mapper.MusicLabelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author zxz
* @description 针对表【music_label(音乐标签)】的数据库操作Service实现
* @createDate 2025-05-09 10:31:17
*/
@Service
public class MusicLabelServiceImpl extends ServiceImpl<MusicLabelMapper, MusicLabel>
    implements MusicLabelService{

    @Autowired
    private MusicLabelMapper musicLabelMapper;

    /**
     * 根据musicId查询标签
     * */
    @Override
    public MusicLabel findLabelById(Integer labelId) {
        return musicLabelMapper.findLabelById(labelId);
    }

    /**
     * 查询标签列表，在随机查询音乐中用到（用于联合查询音乐标签）
     * */
    @Override
    public List<MusicLabel> findLabelList(){
        return musicLabelMapper.findLabelList();
    }
}




